// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
use crate::Result;

/// Implements a [Grafeas](super::stub::Grafeas) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct Grafeas<T>
where
    T: super::stub::Grafeas + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> Grafeas<T>
where
    T: super::stub::Grafeas + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::Grafeas for Grafeas<T>
where
    T: super::stub::Grafeas + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn get_occurrence(
        &self,
        req: crate::model::GetOccurrenceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Occurrence>> {
        self.inner.get_occurrence(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_occurrences(
        &self,
        req: crate::model::ListOccurrencesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListOccurrencesResponse>> {
        self.inner.list_occurrences(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_occurrence(
        &self,
        req: crate::model::DeleteOccurrenceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_occurrence(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_occurrence(
        &self,
        req: crate::model::CreateOccurrenceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Occurrence>> {
        self.inner.create_occurrence(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn batch_create_occurrences(
        &self,
        req: crate::model::BatchCreateOccurrencesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::BatchCreateOccurrencesResponse>> {
        self.inner.batch_create_occurrences(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_occurrence(
        &self,
        req: crate::model::UpdateOccurrenceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Occurrence>> {
        self.inner.update_occurrence(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_occurrence_note(
        &self,
        req: crate::model::GetOccurrenceNoteRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Note>> {
        self.inner.get_occurrence_note(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_note(
        &self,
        req: crate::model::GetNoteRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Note>> {
        self.inner.get_note(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_notes(
        &self,
        req: crate::model::ListNotesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListNotesResponse>> {
        self.inner.list_notes(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_note(
        &self,
        req: crate::model::DeleteNoteRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_note(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_note(
        &self,
        req: crate::model::CreateNoteRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Note>> {
        self.inner.create_note(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn batch_create_notes(
        &self,
        req: crate::model::BatchCreateNotesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::BatchCreateNotesResponse>> {
        self.inner.batch_create_notes(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_note(
        &self,
        req: crate::model::UpdateNoteRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Note>> {
        self.inner.update_note(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_note_occurrences(
        &self,
        req: crate::model::ListNoteOccurrencesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListNoteOccurrencesResponse>> {
        self.inner.list_note_occurrences(req, options).await
    }
}
